package com.customfmxt;

import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;

import net.minecraft.server.v1_12_R1.NBTTagCompound;

public class R1_12_2 extends project{
	public static String get(){
		String CustomName = ((CraftEntity)FEntity).getHandle().getName();	
		if(CustomName == null) {
			CustomName = "";
		}
		if(CustomName.contains(" ")) {
			CustomName = CustomName.replaceAll(" ", "_");
		}
		if(CustomName.equalsIgnoreCase("unknown")) {
			CustomName = FEntity.getType().getName();
			if(CustomName == null) {
				CustomName = "";
			}
			if(CustomName.contains(" ")) {
				CustomName = CustomName.replaceAll(" ", "_");
			}
		}
		
		if(CustomName.equalsIgnoreCase("custom_mob")) {
			CustomName = FEntity.getType().getName();
			if(CustomName == null) {
				CustomName = "";
			}
			if(CustomName.contains(" ")) {
				CustomName = CustomName.replaceAll(" ", "_");
			}
		}
		
		
		
		if(CustomName.length() > 20) {
			CustomName = FEntity.getType().getName();
			if(CustomName == null) {
				CustomName = "";
			}
			if(CustomName.contains(" ")) {
				CustomName = CustomName.replaceAll(" ", "_");
			}
		}
		

		
		
		return CustomName;
	}
	
	public static String CheckGaia(){
		net.minecraft.server.v1_12_R1.Entity NMSentity = ((CraftEntity)FEntity).getHandle();
		NBTTagCompound nbt = new NBTTagCompound();
		NMSentity.c(nbt);
		/*
		 * if(version.contains("1710")) { NMSentity.c(nbt); }
		 * 
		 * if(version.contains("1122")) { NMSentity.c(nbt); }
		 */
		String SpawnName = null;
		int HardMode = nbt.getInt("hardMode");
		if(HardMode == 0) {
			SpawnName = "GaiaI";
		}else if(HardMode == 1){
			SpawnName = "GaiaII";
		}
		return SpawnName;
	}
	
	
	
}